<template>
	<view>
		<headerCome @baocUNsmen="baocUNsmen" :isBaocUNsmen="true"></headerCome>
		<view class="" style="padding: 24rpx;">
			<div class="title">添加证书</div>
			<view class="certificateList" v-for="(item,index) in formData.workcert" >
				<view>
					<image class="icon" src="../../static/wenja.png" mode=""></image>
					<view style="padding-top: 31rpx;">{{item.title}}</view>
				</view>
				<image class="imgrigshtMe" :src="'https://app.zizijy.com/'+item.imgurl" mode=""></image>
				<image @click="delcertificateInformation(item.id,index)" class="reoo" src="../../static/wenjiamen.png" mode=""></image>
			</view>
			<view class="tianiazengs" @click="goPages('/resume/certificate/index')">
				+  添加证书
			</view>
		</view>
		
	</view>
</template>

<script>
	import headerCome from "@/components/header-top.vue"
	import {
		Request
	} from '@/utils/request.js'
	export default{
		components:{
			headerCome
		},
		data(){
			return {
				imgUrl:this.imgUrl,
				userinfo:{},
				formData:{
					label:[],
				},
			}
		},
		onLoad(e) {
			this.userinfo=JSON.parse(uni.getStorageSync('userinfo'));
			this.userInfo();
		},
		methods:{
			goPages(path,_fakse){
				uni.navigateTo({
					url:path
				})
			},
			deleteFuns(indx){
				 this.formData.workcert.splice(indx,1)
				 this.formData =this.formData;
				 uni.showToast({
				 	title:'成功',
				 	icon:'none'
				 })
			},
			delcertificateInformation(itemID,index){
				Request('user/curriculum_vitae/delcertificateInformation',{
					id:itemID,
					user_id:this.userinfo.uid,
				},"POST").then(()=>{
					this.deleteFuns(index);
					
				})
			},
			userInfo(){
				   Request('/user/info').then((res)=>{
					   this.userInfoJson=res;
					   this.formData={
						   ...res,
						   current_residence:res.current_residence?res.current_residence.split(','):[],
						   census_register:res.census_register?res.census_register.split(','):[],
						   operational_field:res.operational_field?res.operational_field.split(','):[],
						   label:res.label?res.label.split(','):[]
					   }
				   })
			},
			baocUNsmen(){
				uni.navigateTo({
					url:`/resume/onLine/index?type=1`
				})
			}
		}
	}
</script>

<style>
	.title{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 40rpx;
		color: #0D0E0F;
		text-align: left;
		font-style: normal;
		padding-bottom: 40rpx;
		text-transform: none;
	}
	.contemNems{
		width: 40%;
	}
	.contemNems .img{
		width: 24rpx;
		height: 24rpx;
	}
	.conMensge.Mens {
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 32rpx;
		color: #8F9294;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}
	.conMensge.Mens .uni-input{
		color: #0D0E0F;
	}
	.conMensge{
		padding: 24rpx 0;
	}
	.subtitle{
		margin-top: 24rpx;
		font-size: 28rpx;
	}
	.imgeuels{
		width: 240rpx;
		height: 240rpx;
		overflow: hidden;
		background: #F2F4F7;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}
	.imgrigshtMe{
		width: 116rpx;
		height: 116rpx;
		border-radius: 12rpx 12rpx 12rpx 12rpx;
	}
	.imgeuels .imgeskue{
		width: 100%;
		height: 100%;
		position: relative;
	}
	.imgeuels .imgeskue::after{
		content: '';
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%,-50%);
		width: 48rpx;
		height: 8rpx;
		background: #8F9294;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
	}
	.imgeuels .imgeskue::before{
		content: '';
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%,-50%);
		width: 8rpx;
		height: 48rpx;
		background: #8F9294;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
	}
	.subcinesm{
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 22rpx;
		color: #8F9294;
		text-align: left;
		margin-bottom: 24rpx;
		font-style: normal;
		text-transform: none;
	}
	.certificateList{
		width: 702rpx;
		height: 180rpx;
		box-sizing: border-box;
		padding: 32rpx;
		display: flex;
		position: relative;
		margin-bottom: 24rpx;
		justify-content: space-between;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		border: 1rpx solid #E4DFDF;
	}
	.certificateList .reoo{
		width: 48rpx;
		position: absolute;
		top: -24rpx;
		right: -24rpx;
		height: 48rpx;
	}
	.certificateList .icon{
		width: 40rpx;
		height: 40rpx;
	}
	.tianiazengs{
		width: 702rpx;
		height: 88rpx;
		line-height: 88rpx;
		text-align: center;
		background: #F2F4F7;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 28rpx;
		color: #646669;
		text-align: center;
		font-style: normal;
		text-transform: none;
	}
</style>